package com.example.userclient;

import android.os.Parcel;
import android.os.Parcelable;

import kotlin.jvm.Transient;

public class AddBookExtension implements Parcelable {
    private AddBook addBook;
    private boolean isSold;
    private String boss;
    private long sellTime;


    @Transient
    private String createTime;
    @Transient
    private String buyTime;

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getBuyTime() {
        return buyTime;
    }

    public void setBuyTime(String buyTime) {
        this.buyTime = buyTime;
    }

    public AddBookExtension() {
    }
    public AddBookExtension(AddBook addBook, boolean isSold, String boss, long sellTime) {
        this.addBook = addBook;
        this.isSold = isSold;
        this.boss = boss;
        this.sellTime = sellTime;
    }

    public AddBook getAddBook() {
        return addBook;
    }

    public void setAddBook(AddBook addBook) {
        this.addBook = addBook;
    }

    public boolean isSold() {
        return isSold;
    }

    public void setSold(boolean sold) {
        isSold = sold;
    }

    public String getBoss() {
        return boss;
    }

    public void setBoss(String boss) {
        this.boss = boss;
    }

    public long getSellTime() {
        return sellTime;
    }

    public void setSellTime(long sellTime) {
        this.sellTime = sellTime;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.addBook, flags);
        dest.writeByte(this.isSold ? (byte) 1 : (byte) 0);
        dest.writeString(this.boss);
        dest.writeLong(this.sellTime);
    }

    public void readFromParcel(Parcel source) {
        this.addBook = source.readParcelable(AddBook.class.getClassLoader());
        this.isSold = source.readByte() != 0;
        this.boss = source.readString();
        this.sellTime = source.readLong();
    }

    protected AddBookExtension(Parcel in) {
        this.addBook = in.readParcelable(AddBook.class.getClassLoader());
        this.isSold = in.readByte() != 0;
        this.boss = in.readString();
        this.sellTime = in.readLong();
    }

    public static final Parcelable.Creator<AddBookExtension> CREATOR = new Parcelable.Creator<AddBookExtension>() {
        @Override
        public AddBookExtension createFromParcel(Parcel source) {
            return new AddBookExtension(source);
        }

        @Override
        public AddBookExtension[] newArray(int size) {
            return new AddBookExtension[size];
        }
    };
}
